
import java.util.Iterator;

public class RandomQueueTest {
    public static void main(String[] args)
    {
        RandomQueue<Integer> q = new RandomQueue<Integer>();
        Stopwatch s = new Stopwatch();
        int n_enq = 10000000;
        int n_sam = 10000000;
        int n_deq = 10000000;
        for(int i = 0; i<n_enq; i++){
            q.enqueue(i);
        }
        double enq = s.elapsedTime();
        for(int i = 0; i<n_sam; i++){
            q.sample();
        }
        double sam = s.elapsedTime() - enq;
        Iterator<Integer> it = q.iterator();
        while(it.hasNext()){
            it.next();
        }
        double itr = s.elapsedTime() - enq - sam;
        for(int i = 0; i<n_deq; i++){
            q.dequeue();
        }
        double deq = s.elapsedTime() - enq - sam - itr;
        System.out.println(n_enq+" enqueues in: "+enq);
        System.out.println(n_sam+" samples in: "+sam);
        System.out.println("Iteration over "+n_enq+" elements: "+itr);
        System.out.println(n_deq+" dequeues in: "+deq);
    }
}
